#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "BMCIR.h"


BMCIR* BMCIRNew(){
    BMCIR* New;
    
    New = malloc(sizeof(BMCIR));
    New->CompleteSource = NULL;
    New->PartialSource = NULL;
    New->FunctionName = NULL;
    
    return New;
}

void BMCIRSetFunctionName(BMCIR* IR, uint16_t StartingAddr){
    char FunctionName[0x80];
    
    sprintf(FunctionName, "__NES__%04X__", StartingAddr);
    
    IR->FunctionName = malloc(strlen(FunctionName) + 1);
    strcpy(IR->FunctionName, FunctionName);
}